package assignment;
import java.util.Scanner;

public class EvenArray 
{
	public static void main(String args[]) 
	{
		Scanner n1=new Scanner (System.in);
		System.out.println("Enter the numbers");
		int arr1[]=new int[10];
		int arr2[]=new int[10];
		for(int i=0;i<arr1.length;i++)
		{
			arr1[i]=n1.nextInt();
		}
		
	    
	    int startArrayPointer=0;
	    int endArrayPointer=arr1.length-1;
	    for(int j=0;j<arr1.length;j++)
	    {
	    	if(arr1[j]%2==0 && startArrayPointer< arr1.length)
	    	{
	    		arr2[startArrayPointer]=arr1[j];
	    		startArrayPointer++;
	    	}
	    	else if(endArrayPointer >=0)
	    	{
	    		arr2[endArrayPointer]=arr1[j];
	    		endArrayPointer=endArrayPointer-1;
	    	}
	    }
	   
	    System.out.println("The formatted array is:");
	    for(int i=0;i<arr2.length;i++)
		{
          System.out.print(arr2[i]+ " ");
		}
	    	
	    	
	    	
	    	
	    
		
	    
	    
		
		
		
	}	
}